<?php
class DigCms_View_Helper_DigCmsInheritContent extends Zend_View_Helper_Abstract
{
    public function digCmsInheritContent(DigCms_Model_Item $item, $field) {
        if(! empty($item->$field)) {
            return $item->$field;
        }
        
        $parents = $item->parents();
        if($parents) {
            foreach($parents as $parent) {
                if(! empty($parent->$field)) {
                    return $parent->$field;
                }
            }
        }

    }
}